﻿<!--
Majesty of Omega - The next evolution of macro management space strategy

Copyright 2007 André Claaßen

This file is protected by the terms and conditions of the
Microsoft Community License (Ms-CL 1.1), a copy of which should
have been distributed along with this software. If not,
you may find the license information at the following URL:

http://www.microsoft.com/resources/sharedsource/licensingbasics/communitylicense.mspx
-->
<Page
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="Majesty_of_Omega.GUI.Pages.MainPage"
    Title="Main Page"
    Width="Auto" Height="Auto"
    xmlns:Majesty_Commands="clr-namespace:Majesty_of_Omega.GUI.Commands"
    xmlns:Pages="clr-namespace:Majesty_of_Omega.GUI.Pages" 
    xmlns:Parts="clr-namespace:Majesty_of_Omega.GUI.Pages.Parts" 
    xmlns:Majesty_of_Omega_GUI="clr-namespace:Majesty_of_Omega.GUI" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignWidth="1018.333" d:DesignHeight="775" x:Name="page" 
    xmlns:Majesty_of_Omega_GUI_Controls="clr-namespace:Majesty_of_Omega.GUI.Controls" 
    xmlns:Majesty_of_Omega_GUI_Controller="clr-namespace:Majesty_of_Omega.GUI.Controller" 
    >
    <Page.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/Resources/PanelResources.xaml"/>
                <ResourceDictionary Source="pack://application:,,,/Resources/MainScreens.xaml"/>
            </ResourceDictionary.MergedDictionaries>

            <SkewTransform x:Key="StandardSkewTransform" AngleX="-10" AngleY="0"/>

            <!-- The following styles enables the typical moo3 alpha buttons -->
            <Style x:Key="ButtonFocusVisual">
                <Setter Property="Control.Template">
                    <Setter.Value>
                        <ControlTemplate>
                            <Rectangle SnapsToDevicePixels="true" Margin="3" Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1"/>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <Style x:Key="buttonMenuTemplate" TargetType="{x:Type Button}">
                <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
                <Setter Property="Width" Value="Auto" />
                <Setter Property="Height" Value="Auto" />
                <Setter Property="FontSize" Value="12" />
                <Setter Property="FontWeight" Value="Bold" />
                <Setter Property="Foreground" Value="#FFFBFBFB"  />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Button}">
                            <Grid Width="Auto" Height="Auto">
                                <Path x:Name="borderPath" VerticalAlignment="Stretch" Height="30" Fill="#FF7C9FEE" Stretch="Fill" Stroke="#FFFFFFFF" StrokeThickness="1" Data="M-0.5002848,21.078175 L-0.50023649,1.8605276 C-0.50023649,1.8605276 0.64980505,-3.786531 7.5,-3.7865311 12.849715,-3.7865312 128.89972,-3.7865312 128.89972,-3.7865312 L128.59972,20.795822 z" Margin="0,8,0,8"/>
                                <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" RecognizesAccessKey="True" OpacityMask="#FFFFFFFF" HorizontalAlignment="Center" OverridesDefaultStyle="True" VerticalAlignment="Center" x:Name="contentPresenter" />
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsMouseOver" Value="true">
                                    <Setter TargetName="borderPath" Property="Fill" Value="Orange" />
                                </Trigger>
                                <EventTrigger RoutedEvent="FrameworkElement.Loaded"/>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Storyboard x:Key="StoryboardMenuFadeAway" Duration="00:00:01" >
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:01" Storyboard.TargetName="MenuButtonPanel" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:01" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
                <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:01" Storyboard.TargetName="MenuButtonPanel" Storyboard.TargetProperty="(UIElement.Visibility)">
                    <DiscreteObjectKeyFrame KeyTime="00:00:01" Value="{x:Static Visibility.Hidden}"/>
                </ObjectAnimationUsingKeyFrames>
            </Storyboard>
            <Storyboard x:Key="StoryboardMenuReturnBack" Duration="00:00:01">
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:01"  Storyboard.TargetName="MenuButtonPanel" Storyboard.TargetProperty="(UIElement.Opacity)">
                    <SplineDoubleKeyFrame KeyTime="00:00:01" Value="100"/>
                </DoubleAnimationUsingKeyFrames>
                <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:01"  Storyboard.TargetName="MenuButtonPanel" Storyboard.TargetProperty="(UIElement.Visibility)">
                    <DiscreteObjectKeyFrame KeyTime="00:00:01" Value="{x:Static Visibility.Visible}"/>
                </ObjectAnimationUsingKeyFrames>
            </Storyboard>
        </ResourceDictionary>
    </Page.Resources>

    <Page.CommandBindings>
		<CommandBinding Command="Majesty_Commands:MainCommands.CancelSubFrameCommand" Executed="OnCloseSubFrame" />
        <CommandBinding Command="Majesty_Commands:MainCommands.NewGameCommand" Executed="OnNewGame" />
        <CommandBinding Command="Majesty_Commands:MainCommands.LoadGameCommand" Executed="OnLoadGame" />
		<CommandBinding Command="ApplicationCommands.Close" Executed="OnQuit" />
    </Page.CommandBindings>

    <Grid x:Name="LayoutRoot" Background="{DynamicResource PlanetStdBackground}">

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="381.442"/>
            <ColumnDefinition Width="272.005"/>
            <ColumnDefinition Width="126.11"/>
            <ColumnDefinition Width="96.276"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="0.258*"/>
            <RowDefinition Height="0.742*"/>
        </Grid.RowDefinitions>

        <Grid.DataContext>
            <Majesty_of_Omega_GUI_Controller:MainPageController/>
        </Grid.DataContext>

        <!-- Title Decoration with galaxy -->
        <Image Source="pack://application:,,,/Images/galaxy.jpg" Stretch="Fill" x:Name="GalaxyImage" HorizontalAlignment="Left" Width="Auto" Grid.ColumnSpan="5" Grid.RowSpan="2" Margin="0,-3.601,0,3.601"/>
        <Viewbox Grid.Column="1" Grid.ColumnSpan="4" Grid.Row="1" Grid.RowSpan="1" Stretch="Fill">
            <Path Style="{DynamicResource MooE3Style}" 
				Data="M1144,192 L1095.6527,191.80483 C1095.6527,191.80483 1082.9805,199.50629 1075.7576,222.3936 1068.9916,243.83281 983.6424,653.77686 983.6424,653.77686 983.6424,653.77686 975.31081,687.75079 951.3108,687.75079 919.31041,687.75079 478.79882,689.42635 478.79882,689.42635 478.79882,689.42635 464.78393,684.59717 451.25204,700.67658 439.7337,714.36336 425.43802,765.66562 425.43802,765.66562 L1145.1674,766.27738 z" x:Name="RightBorderPath" Width="700" Height="772.213" />
        </Viewbox>
        <Path Style="{DynamicResource MooE3Style}" HorizontalAlignment="Stretch" x:Name="TopBorderPath"  Margin="-1.156,-3.601,-130.18,0" VerticalAlignment="Top" Height="100.603" Data="M0.057524615,83.99883 C21.764724,83.99883 486.06587,84.001833 500.53733,84.001833 515.00881,84.001833 527.00116,68.621407 533.38195,61.566653 540.61768,53.566646 553.04142,9.8557591 553.04142,9.8557591 553.04142,9.8557591 557.01436,-3.5872403 567.61868,-4.0015175 593.22506,-5.0018784 689.49304,-3.7058206 750.08174,-3.9999993 776.32806,-4.1274341 771.78879,-11.999984 771.78879,-11.999984 L-2.5754959,-14.600979 z" Grid.ColumnSpan="2"/>
        <Path Margin="0,20,0,0" VerticalAlignment="Top" Height="64" Fill="{x:Null}" Stretch="Fill" Stroke="#FF899CF0" StrokeThickness="6" Data="F1 M1066.4134,2.999997 L1066.4131,58.999575 1089.7629,2.9999665 1120.8966,2.999668 1120.8969,58.999994 1066.412,58.999999 1066.412,2.9999665 1043.0622,58.999575 2.0004685,60 2.0000019,4.0000081 z" Grid.ColumnSpan="5">
            <Path.BitmapEffect>
                <OuterGlowBitmapEffect GlowColor="#FF0018FF"/>
            </Path.BitmapEffect>
        </Path>

        <!-- title text -->
        <TextBlock Style="{DynamicResource MooTitleStyle}" Grid.Column="2" d:LayoutOverrides="Width, GridBox" Margin="-27.569,33,49.409,0" ><Run Text="Majesty of Omega" Language="de-de"/></TextBlock>
        <Parts:MenuButtonPanelControl x:Name="MenuButtonPanel" RenderTransformOrigin="0.5,0.5" Grid.Column="2" Grid.Row="1" d:LayoutOverrides="Height">
            <Parts:MenuButtonPanelControl.RenderTransform>
                <TransformGroup>
                    <ScaleTransform ScaleX="1" ScaleY="1"/>
                    <SkewTransform AngleX="0" AngleY="0"/>
                    <RotateTransform Angle="0"/>
                    <TranslateTransform X="0" Y="0"/>
                </TransformGroup>
            </Parts:MenuButtonPanelControl.RenderTransform>
        </Parts:MenuButtonPanelControl>
        <StackPanel Visibility="Hidden" Margin="32.837,0,-32.999,71.049" VerticalAlignment="Bottom" Height="46.5" Orientation="Horizontal" HorizontalAlignment="Stretch" Width="380" x:Name="LoadButtonsStackPanel" Grid.Column="2" Grid.Row="1" Grid.ColumnSpan="2">
            <Button Width="154" Height="46.5" Content="Laoad" Margin="0,0,20,0"/>
            <Button Width="154" Height="46.5" Content="Cancel" Margin="0,0,20,0"/>
        </StackPanel>

        <Frame x:Name="SubscreenFrame" Background="{x:Null}" Grid.ColumnSpan="5" Grid.RowSpan="2" NavigationUIVisibility="Hidden" d:IsHidden="True" />
        <TextBlock HorizontalAlignment="Right" Margin="0,0,8,8" VerticalAlignment="Bottom" Width="Auto" Height="Auto" Grid.Column="4" Grid.Row="1" Text="{Binding Path=AssemblyVersion, ElementName=page, Mode=Default}" TextWrapping="Wrap" Foreground="#FFFFFDFD" FontWeight="Bold" x:Name="VersionInfo"/>
        <Canvas HorizontalAlignment="Stretch" Margin="32,0,30,25" x:Name="CreditsMarqueeCanvas" VerticalAlignment="Bottom" Height="35" Grid.ColumnSpan="5" Grid.Row="1" Panel.ZIndex="100" Loaded="CreditsMarqueeCanvas_Loaded">
            <Majesty_of_Omega_GUI_Controls:MooTextBlock  x:Name="CreditsMarqueeText" 
        		Foreground="#FFFFFFFF" FontWeight="Normal" FontSize="16" FontFamily="Impact" 
        		RenderTransformOrigin="0.5,0.5" 
        		d:LayoutOverrides="Height" RichText="{Binding Path=CreditsText, Mode=Default}"  
                >
        		<Majesty_of_Omega_GUI_Controls:MooTextBlock.RenderTransform>
        			<TransformGroup>
        				<ScaleTransform ScaleX="1.5" ScaleY="1"/>
        				<SkewTransform AngleX="-16" AngleY="0"/>
        				<RotateTransform Angle="0"/>
        				<TranslateTransform X="0" Y="0"/>
        			</TransformGroup>
        		</Majesty_of_Omega_GUI_Controls:MooTextBlock.RenderTransform>
        		<Majesty_of_Omega_GUI_Controls:MooTextBlock.Triggers>
        			<EventTrigger RoutedEvent="FrameworkElement.Loaded">
        				<BeginStoryboard>
        					<Storyboard>
        						<DoubleAnimationUsingKeyFrames 
        							BeginTime="00:00:00" 
        							RepeatBehavior="Forever"
        							Storyboard.TargetName="{x:Null}" 
        							Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
        							<SplineDoubleKeyFrame x:Name="ScrollBeginKeyFrame" KeyTime="00:00:00" Value="00"/>
        							<SplineDoubleKeyFrame x:Name="ScrollEndKeyFrame" KeyTime="00:01:30" Value="-2000"/>
        						</DoubleAnimationUsingKeyFrames>
        					</Storyboard>
        				</BeginStoryboard>
        			</EventTrigger>
        		</Majesty_of_Omega_GUI_Controls:MooTextBlock.Triggers>
        	</Majesty_of_Omega_GUI_Controls:MooTextBlock>
        </Canvas>
    </Grid>
</Page>
